<template>
  <div id="app">
    <header class="header">
      <span @click="back" class="btn">
        <lbr-icon type='lbr-icon-houtui' color='#000' :size='20'></lbr-icon>
      </span>
      {{title}}
    </header>
    <div class="rowheight"></div>
    <router-view />
  </div>
</template>
<script>
export default {
  name: "app",
  data() {
    return {
      title:''
    };
  },
  created() {},
  watch: {
    $route(to, from) {
      this.title=to.name || from.name
    }
  },
  methods: {
    back() {
      this.$router.go(-1);
    }
  }
};
</script>

<style lang="scss" scoped >
.header {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 40PX;
  line-height: 40PX;
  background: #fff;
  z-index: 99;
  font-size: 36px;
  text-align: center;
  border-bottom: 1PX solid #eee;
  .btn{
    position: absolute;
    left: 10px;top: 0;
    display: block;
  }
}
.rowheight {
  height: 40PX;
}
</style>